OID Registry
This crate is a helper crate, containing a database of OID objects. These objects are intended for use when manipulating ASN.1 grammars and BER/DER encodings, for example.
This crate provides only a simple registry (similar to a HashMap
) by default. This object can
be used to get names and descriptions from OID.
This crate provides default lists of known OIDs, that can be selected using the build features. By default, the registry has no feature enabled, to avoid embedding a huge database in crates.
It also declares constants for most of these OIDs.
use OidRegistry;
let mut registry = default
.with_crypto // only if the 'crypto' feature is enabled
;
let e = registry.get;
if let Some = e
Extending the registry
These provided lists are often incomplete, or may lack some specific OIDs. This is why the registry allows adding new entries after construction:
use oid;
use ;
let mut registry = default;
// entries can be added by creating an OidEntry object:
let entry = new;
registry.insert;
// when using static strings, a tuple can also be used directly for the entry:
registry.insert;
Versions and compatibility with asn1-rs
Versions of oid-registry
must be chosen specifically, to depend on a precise version of asn1-rs
.
The following table summarizes the matching versions:
oid-registry
0.7.x depends onasn1-rs
0.6.0oid-registry
0.6.x depends onasn1-rs
0.5.0oid-registry
0.5.x depends onasn1-rs
0.4.0
Contributing OIDs
All OID values, constants, and features are derived from files in the assets
directory in the
build script (see build.rs
).
See load_file
for documentation of the file format.
Rust version requirements
oid-registry
requires Rustc version 1.63 or greater, based on proc-macro
attributes support and asn1-rs
.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.